﻿using System;
using System.Collections;
using System.Configuration;
using System.Web.Configuration;
using HospitalSystem.Core;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace HospitalSystem
{
    public partial class servicerecord2 : System.Web.UI.Page
    {
        private servicerecordLog _SA;
        string svccode = WebConfigurationManager.AppSettings["svccode1"];
        protected void Page_Load(object sender, EventArgs e)
        {

            if (Session["PSNumber01"] == null)
            {

                MessageBox2("กรุณากดค้นหา หรือลงทะเบียนการคัดกรองเด็กก่อน", "checkcid2.aspx");

            }

            else
            {
                _SA = new servicerecordLog();
                if (!IsPostBack)
                {

                    _SA.BindData(GridView1, svccode);

                    String ShowValue = (string)Session["PSNumber01"];
                    psnumber.Text = ShowValue;
                    _SA.readtodatatable(psnumber, GridView1, GridView11, svccode);

                }
            }


        }

        private void MessageBox2(string msg, string urld)
        {
            Label lbl = new Label();
            lbl.Text = "<script language='javascript'>" + Environment.NewLine + "window.alert('" + msg + "');" + "window.location.href='" + urld + "';" + "</script>";
            Page.Controls.Add(lbl);
        }
       

        protected void Button1_Click(object sender, EventArgs e)
        {
            _SA.procesbutton(SelectStat,GridView1,psnumber,GridView11,svccode);
            //กดปุ่มแล้วแล้วทำงานตามต้องการ

        }



    




    }
}